package com.yami.shop.security.service;

import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;
import java.util.Collections;

@Getter
@Setter
public class StoreUser extends User{

    /**
     * 用户ID
     */
    @Getter
    private Long id;
    /**
     * 商家店铺ID
     */
    @Getter
    private Long shopId;

//    public StoreUser(Long id, Long shopId, String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
//        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked,authorities);
public StoreUser(Long id, Long shopId, String username, String password, boolean enabled) {
        super(username, password, enabled, true, true, true,Collections.emptyList());
//    public StoreUser(Long id, Long shopId, String username, String password) {
//        super(username, password, Collections.emptyList());
        this.id = id;
        this.shopId = shopId;
    }
}
